package com.bienvenue.main.ui.fragment.personal;

import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;

import com.bienvenue.main.R;
import com.bienvenue.main.base.BaseFragment;
import com.bienvenue.main.ui.activity.ContactUsActivity;
import com.bienvenue.main.ui.activity.SettingActivity;
import com.bienvenue.main.ui.activity.UserDetailsActivity;
import com.bienvenue.main.ui.activity.personal.AllInterviewsActivity;
import com.bienvenue.main.ui.activity.personal.CollectionsActivity;
import com.bienvenue.main.ui.activity.personal.PersonalAboutActivity;
import com.bienvenue.main.ui.activity.personal.PhoneSmsLoginActivity;
import com.bienvenue.main.ui.activity.personal.ResumeManagerActivity;
import com.bienvenue.main.ui.activity.personal.ResumeRefreshActivity;


import butterknife.BindView;
import butterknife.OnClick;

/**
 * @ProjectName: Bienvenue
 * @Package: com.bienvenue.main.ui.fragment
 * @ClassName: MeFragment
 * @Description: 我的Fragment
 * @Author: Mr.Chen
 * @CreateDate: 2020/9/7 11:12
 * @UpdateUser: Mr.Chen
 * @UpdateDate: 2020/9/7 11:12
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */


public class MeFragment extends BaseFragment {

    PopupWindow mMenuPopWindow;

    @BindView(R.id.iv_setting_btn)
    ImageView ivSettingBtn;
    @Override
    protected void initData() {

    }

    @Override
    protected void initView(View view) {

    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_me;
    }

    @OnClick(R.id.iv_avatar)
    void onAvatar(){
       startActivity(new Intent(getActivity(), UserDetailsActivity.class));
    }
    @OnClick(R.id.tv_no_register_or_login)
    void onNoRegisterOrLogin(){
      startActivity(new Intent(getActivity(), PhoneSmsLoginActivity.class));
      getActivity().finish();
    }
    @OnClick(R.id.ll_position_collection)
    void onCollectionMe(){
        startActivity(new Intent(getActivity(), CollectionsActivity.class));

    }
    @OnClick(R.id.ll_resume_manager)
    void onOnlineResume(){
       startActivity(new Intent(getActivity(), ResumeManagerActivity.class));
    }
    @OnClick(R.id.ll_interview_manager)
    void onInterView(){
        startActivity(new Intent(getActivity(), AllInterviewsActivity.class));
    }
    @OnClick(R.id.ll_about)
    void onResumes(){
        startActivity(new Intent(getActivity(), PersonalAboutActivity.class));
    }
    @OnClick(R.id.ll_refresh_resume)
    void onPositionMoney(){
     startActivity(new Intent(getActivity(), ResumeRefreshActivity.class));
    }
    @OnClick(R.id.iv_setting_btn)
    void onSetting(){
//        View popupView = getActivity().getLayoutInflater().inflate(R.layout.popwin_share, null);
//         mMenuPopWindow = new PopupWindow(popupView, WindowManager.LayoutParams.WRAP_CONTENT,
//                WindowManager.LayoutParams.WRAP_CONTENT, true);
//        showPopWindow();
//        RelativeLayout send_message_ll=popupView.findViewById(R.id.send_message_ll);
//        RelativeLayout create_group_ll=popupView.findViewById(R.id.create_group_ll);
//        RelativeLayout add_friend_with_confirm_ll=popupView.findViewById(R.id.add_friend_with_confirm_ll);
//        send_message_ll.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                startActivity(new Intent(getActivity(), ContactUsActivity.class));
//            }
//        });
        startActivity(new Intent(getActivity(), SettingActivity.class));


    }
    public void showPopWindow() {
        mMenuPopWindow.setTouchable(true);
        mMenuPopWindow.setOutsideTouchable(true);
        mMenuPopWindow.setBackgroundDrawable(new BitmapDrawable(getResources(), (Bitmap) null));
        if (mMenuPopWindow.isShowing()) {
            mMenuPopWindow.dismiss();
        } else {
            mMenuPopWindow.showAsDropDown(ivSettingBtn, -10, -5);
        }
    }

}
